# Add Get-AllHistory function for powershell

<#
   .SYNOPSIS
   # Get-AllHistory
   Get all history of powershell
   # Get-AllHistory n
   Show the last n history records
   .DESCRIPTION
   The function add by Kody
#>
param (
	$Count
)
if($Count){
	$his = Get-Content (Get-PSReadLineOption).HistorySavePath -tail $Count
}
else{
	$his = Get-Content (Get-PSReadLineOption).HistorySavePath
}
$n = $his.Length
$out = @()
for($i=1;$i -le $n;$i++)
{
	$out = $out + "$i $($his[$i-1])"
}

<#
ForEach ($Item in $out) {
	Write-Host $Item
}
#>

return $out
